<p>Detection and analysis in brightfield images requires stain separation based on the method of <b>color deconvolution</b> (Ruifrok &amp; Johnston, 2001)<p>

<p>This requires an accurate characterization of both the <b>background</b> (white) intensity and the <b>stain colors</b> present within the image.  The latter depends not only upon the stains used, but also other factors such as the scanner.</p>

<details>
<summary>Color differences</summary>
<div class="fig">
<img src="images/Leica_Ventana_Aperio_Hama.jpg" class="shadowed" />
<figcaption>
Comparison of stain colors for breast cancer images stained to CD3+ cells. <br/>
Slides at the top and bottom were stained with a different antibody/staining kit (from Leica and Ventana respectively). <br />
Slides at the left and right were acquired using different scanners (Aperio and Hamamatsu respectively). <br />
</figcaption>
</div>
</details>

<p>Stain colors are represented by vectors containing 3 elements, one for each of the red, green and blue color components.</p>

<p>Analysis may sometimes be carried out using default stain vectors representing 'typical' H-DAB or H&amp;E stains. However the results using this approach will be sub-optimal, and the default vectors may be far from representing the true stains used within the image. This can lead to unrealistic results, such as negative quantities of particular stains.</p>

<p>The&nbsp;<b>Estimate stain vectors</b>&nbsp;command is able to determine both the background intensity and stain vector estimates based on the colors found within the image.</p>

<p>It may be applied to an entire image, however for best results it is best to draw an annotation around an area free from artefacts, which also contains relatively 'pure' examples of each stain and background - so as to ensure that the estimate is as accurate as possible.</p>

<details>
<summary>Screenshots</summary>

<div class="fig">
<img src="images/Stains_Aperio.jpg" class="shadowed" />
<figcaption>
Stain color estimation using a slide scanned with an Aperio scanner.
</figcaption>
</div>

<div class="fig">
<img src="images/Stains_Hama.jpg" class="shadowed" />
<figcaption>
Stain color estimation using a slide scanned with an Hamamatsu scanner.
</figcaption>
</div>

</details>